package mock;
import model.interfaces.Rule;




public class YoungPatientRule implements Rule{

    private boolean verified;
    
    @Override
    public void addObject(Object object) {
        if (object instanceof Patient) {
            Patient pacient = (Patient)object;
            
            if (pacient.getAge() <= 20) {
                verified = true;
            } else {
                verified = false;
            }
        }
    }

    @Override
    public boolean verify() {
        return verified;
    }

    @Override
    public void reset() {
        verified = false;
    }    
}
